**************************************************
* This program performs the empirical tests      *
* on event study around COW law passage          *
* and ROA after COW law enactment                *
* reported in Appendix B                         *
**************************************************

	use "C:\cow\car.dta",clear

	gen car100=car*100

	encode incorp, gen(istateFE)
	encode state, gen(lstateFE)

	
************************************************
* Figure B.1: Market reaction to COW adoptions *
************************************************
	
	expand 2, generate (Allfirms)
	
	gen sizegroup="Large cap" if Allfirms==0 & mktcap>10000
	replace sizegroup="Mid cap" if Allfirms==0 & mktcap<10000 & mktcap>3000
	replace sizegroup="Small cap" if Allfirms==0 & mktcap<3000
	
	replace sizegroup="All firms" if Allfirms==1
	
	generate sorder = 1 if sizegroup=="Small cap"
	replace sorder = 2 if sizegroup=="Mid cap"
	replace sorder = 3 if sizegroup=="Large cap"

	graph bar (mean) car100, bargap(5) graphregion(color(white)) over(Allfirms) over(sizegroup, sort(sorder) gap(250)) blabel(bar, format(%5.2f)) ylabel(0(.5)1.5) /// 
	ytitle("Cumulative abnormal return (-1,+1) %") ylabel(, angle(horizontal)) bar(1, color(blue*0.7))  /// 
	title("Market reaction to COW adoption by firm size") nofill




* process variables for regression equations 3 and 4 in section B.1.
	
	gen smallcap=0 
	replace smallcap=1 if mktcap<3000

	replace rdassets=0 if missing(rdassets)
	replace lag1_rdassets=0 if missing(lag1_rdassets)
	replace lag2_rdassets=0 if missing(lag2_rdassets)
	replace lag3_rdassets=0 if missing(lag3_rdassets)

	winsor2 roa lead1_roa lead2_roa lead3_roa lag1_roa lag2_roa lag3_roa lag1_rdassets lag2_rdassets lag3_rdassets, replace cuts(1 99) trim

	gen chgroa3 = ((lead1_roa+lead2_roa+lead3_roa)/3) - ((lag1_roa+lag2_roa+lag3_roa)/3)

	gen rdassets_smallcap=rdassets*smallcap 

	
****************************************************************************	
* Regression eq 3 section B.1.1 Event study around the passing of COW laws * 	
****************************************************************************	

	reghdfe car100 smallcap##c.rdassets , absorb (incorp fyear sic2) 	
	
*************************************************************	
* Regression eq 4 section B.1.2 ROA after COW law enactment * 	
*************************************************************	

	reghdfe chgroa3 smallcap rdassets rdassets_smallcap, absorb (incorp sic2) 	


	
